package com.aaa.service.impl;

import com.aaa.dao.T_QuestionBankDao;
import com.aaa.service.T_QuestionBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Author: TT
 * @Date: 2019/3/18 9:48
 * @Version 1.0
 */
@Service
public class T_QuestionBankServiceImpl implements T_QuestionBankService {
   @Autowired
    T_QuestionBankDao dao;
    @Override
    public int getCount(Map map) {
        return dao.getCount(map);
    }

    @Override
    public List<Map> getList(Map map) {
        return dao.getList(map);
    }

    @Override
    public int add(Map map) {

        //获取前台传过来的文件和图片路径，是数组形式
        String filePath = "";
        //获取前台传过来的文件路径，是数组形式
        List fileList = (List) map.get("filePath");
        for (int i = 0; i < fileList.size(); i++) {
            filePath = (String) fileList.get(i);
        }
        map.put("filePath", filePath);
        return dao.add(map);
    }

    @Override
    public int delete(Integer id) {
        return dao.delete(id);
    }
}
